A random number generator (often abbreviated as RNG) is a computational or physical device designed to generate a sequence of numbers or symbols that lack any pattern, i.e., appear random. Computer-based systems for random number generation are widely used, but often fall short of this goal, though they may meet some statistical tests for randomness intended to ensure that they do not have any easily discernible patterns. Methods for generating random results have existed since ancient times, including dice, coin flipping, the shuffling of playing cards, the use of yarrow stalks in the I Ching, and many other techniques.
Pseudo-random number generators (“PRNG”s) are algorithms that can automatically create long runs (for example, millions of numbers long) with good random properties but eventually the sequence repeats exactly (or the memory usage grows without bound). One of the most common PRNGs is the linear congruential generator, which uses the recurrence Xn+1=(aXn+b) mod m to generate numbers. The maximum number of numbers the formula can produce is the modulus, m. Most computer programming languages include functions or library routines that purport to be random number generators. They are often designed to provide a random byte or word, or a floating point number, uniformly distributed between 0 and 1. Such library functions often have poor statistical properties and some will repeat patterns after only tens of thousands of trials. They are often initialized using a computer's real time clock as the seed. These functions may provide enough randomness for certain tasks (for example video games) but are unsuitable where high-quality randomness is required, such as in cryptographic applications, statistics or numerical analysis. Many operating systems provide better PRNGs with statistically more random results. Yet, they are still pseudo-random and often compute intensive.
There is general agreement that, if there are such things as “true” random numbers, they are most likely to be found by looking at physical processes which are, as far as we know, unpredictable. This unpredictability is the distinguishing factor of a true random number generator (“TRNG”). A physical random number generator can be based on an essentially random atomic or subatomic physical phenomenon whose randomness can be traced to the laws of quantum mechanics. An example of this are the Atari 8-bit computers, which used noise from an analog circuit to generate true random numbers. Other examples include radioactive decay, thermal noise, shot noise and clock drift. To provide a degree of randomness intermediate between specialized hardware on the one hand and algorithmic generation on the other, some security related computer software requires the user to input a lengthy string of mouse movements, or keyboard input. All of these random number generators utilizing physical processes are slow (in terms of computer speeds), expensive, and invariably require custom hardware that typically cannot be integrated onto an integrated circuit (“IC”).